% V20210224 - 18.2.6 Gallery Demo INCLUDE "GW.bas" % Check if the GW Gallery is there. % If not, download it! GW_DOWNLOAD_THIRD_PARTY("GW_GALLERY.bas") % Register the GW Gallery. INCLUDE "GW_GALLERY.bas" % Make an array of online images. DIM img$[12] FOR i = 1 TO 12 img$[i] = "http://mougino.free.fr/tmp/GW/sample" + RIGHT$("0"+INT$(i), 2) + ".jpg" NEXT % Create a page. p = GW_NEW_PAGE() % Prepare title bar string. title$ = GW_ADD_BAR_TITLE$("GW Gallery demo") % Add title to page. GW_ADD_TITLEBAR(p, title$) % Add a text. GW_ADD_TEXT(p, "This is a GW Gallery filled with online images:") % Add a GW Gallery with thumbnails 120px high. gal = GW_ADD_GALLERY(p, 120, img$[]) % Add a button. GW_ADD_BUTTON(p, "Shuffle the gallery", "SHUF") % Render the page GW_RENDER(p) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Place here any necessary code to process user actions. % User pressed the Shuffle button. IF r$ = "SHUF" ARRAY.SHUFFLE img$[] GW_AMODIFY(gal, "content", img$[]) % Pressing the Back key when the gallery is open closes it. ELSE IF r$ = "BACK" & GW_GALLERY_IS_OPEN(gal) GW_CLOSE_GALLERY (gal) r$ = "" END IF % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of GW Gallery demo"